<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>超级分类</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style>
        html,
        body {
            background-color: #fff;
            height: 100%;
        }

        .aui-bar-nav {
            /*padding: 0 11px 0 13px;
        box-sizing: border-box;*/
            top: 0;
            line-height: 2.25rem;
            color: #ffffff;
            background: linear-gradient(266deg, #7D0DFB, #D115FD);
        }

        .aui-bar-nav .aui-btn .aui-iconfont {
            font-size: 0.9rem;
            line-height: 1.25rem;
            padding: 0;
            margin: 0;
            color: #000000;
        }

        .aui-bar-nav .aui-title {
            min-height: 2.25rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            right: 5rem;
            left: 5rem;
            width: auto;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
            color: #fff;
            font-size: 17px;
        }

        .aui-btn span {
            width: 22px;
            height: 22px;
        }

        .aui-btn span img {
            width: 22px;
            height: 22px;
        }

        .aui-bar-nav .aui-pull-right {
            padding: 0 11px;
            font-size: 0.8rem;
            font-weight: 400;
            z-index: 2;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
            -webkit-align-items: center;
            align-items: center;
        }

        button,
        .aui-btn {
            position: relative;
            display: inline-block;
            font-size: 0.7rem;
            font-weight: 400;
            font-family: inherit;
            text-decoration: none;
            text-align: center;
            margin: 0;
            background: #EEEEEE;
            padding: 0 15px!important;
            height: 1.5rem;
            line-height: 1.5rem;
            border-radius: 0.2rem;
            white-space: nowrap;
            text-overflow: ellipsis;
            vertical-align: middle;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-user-select: none;
            user-select: none;
        }

        .aui-pull-right {
            font-size: 15px;
            color: #222222!important;
            text-align: right;
        }

        .category {
            width: 84px;
            height: 100%;
            /*padding: 0 15px;*/
            box-sizing: border-box;
            border-right: 0.5px solid #EEEEEE;
            /*border: none;
          background-size: 100% 1px;
          background-repeat: no-repeat;
          background-position: right;
          background-image: linear-gradient(0, #EEEEEE, #EEEEEE 50%, transparent 50%);
          background-image: -webkit-linear-gradient(90deg, #EEEEEE, #EEEEEE 50%, transparent 50%);*/
            /*overflow: hidden;*/
        }

        .category ul {
            width: 100%;
            overflow: hidden;
        }

        .category ul li {
            width: 54px;
            /*padding: 0 17.5px;*/
            height: 22px;
            line-height: 22px;

            border-radius: 11px;
            font-size: 12px;
            text-align: center;
            font-family: PingFang SC;
            font-weight: 400;
            color: #333333;
            margin-left: 15px;
            margin-top:15px;
        }
        .selected{
           background: linear-gradient(266deg, #7D0DFC, #D116FD);
           color: #fff!important;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav" id="header">
        <a class="aui-pull-left aui-btn" tapmode onclick="closeWin()">
            <span>
               <img src="../../image/white_back.png" alt="">
            </span>
        </a>
        <div class="aui-title">超级分类</div>
    </header>
    <div class="category" id="app">
        <ul>
            <li v-for='(item,index) in good_name_list' :class="{'selected':isActive==index}" tapmode @click="change(index)">{{item}}</li>
            <!-- <li>女装</li> -->
        </ul>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/cling.js"></script>
<script type="text/javascript">
    apiready = function() {
        cl.apiready();
        var header = $api.byId('header');
        // var footer = $api.byId('footer');
        // var footerH = $api.offset(footer).h;
        var headerH = $api.fixStatusBar(header);
        api.openFrameGroup({
            name: 'categoryGroup',
            background: '#FAF9F9',
            scrollEnabled: false,
            rect: {
                x: 84,
                y: headerH,
                w: 'auto',
                h: 'auto'
            },
            index: 1,
            frames: [{
                name: 'category_frame',
                url: 'category_frame.html',
                bounces: true,
                bgColor: "#FAF9F9"
            }]
        }, function(ret, err) {
            if (ret) {
                alert(JSON.stringify(ret));
            } else {
                alert(JSON.stringify(err));
            }
        });

        // cl.openFrame({
        //     name: './category_frame',
        //     header: header,
        //     bounces: true,
        //     bgColor: "#FAF9F9"
        // });
    }

    var vm = new Vue({
      el:"#app",
      data:{
         isActive:0,
         good_name_list:['男装','女装','内衣','美妆','配饰','鞋品','箱包','儿童','母婴','居家','美食','数码','家电','车品','茶叶']
      },
      methods:{
        change:function(index){
           vm.isActive = index;
        }
      }
    })

    function closeWin() {
        cl.closeWin({
            name: 'category'
        })
    }
</script>

</html>
